// 月卡管理相关接口
import request from '@/utils/request'

/**
 * 获取月卡信息列表
 * @param {*} params { page, pageSize, carNumber, personName, cardStatus }
 * @returns 
 */
export const getCardListAPI = (params) => {
    return request({
        url: '/parking/card/list',
        method: 'GET',
        params
    })
}

/**
 * 新增月卡
 * @param {*} data 
 * @returns 
 */
export const createCardAPI = (data) => {
    return request({
        url: '/parking/card',
        method: 'POST',
        data
    })
}

/**
 * 获取月卡详情
 * @param {*} id 月卡id 
 * @returns 
 */
export const getCardDetailAPI = (id) => {
    return request({
        url: `/parking/card/detail/${id}`,
        method: 'GET'
    })
}

/**
 * 更新月卡
 * @param {*} data 
 * @returns 
 */
export const updateCardAPI = (data) => {
    return request({
        url: '/parking/card/edit',
        method: 'PUT',
        data
    })
}

/**
 * 删除月卡
 * @param {} idList 
 * @returns 
 */
export const delCardAPI = (idList) => {
    return request({
        url: `/parking/card/${idList.join(',')}`,
        method: 'DELETE'
    })
}